package com.weirong.smartvault.backservice.util.common;

import java.sql.Timestamp;
import java.util.Calendar;

public class TimeUtil {

    public static Timestamp getTheBeginOfToday()
    {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        return new Timestamp(calendar.getTime().getTime());
    }

    public static Timestamp getTheEndOfToday()
    {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        calendar.set(Calendar.MINUTE, 59);
        calendar.set(Calendar.SECOND, 59);
        return new Timestamp(calendar.getTime().getTime());
    }


}
